package com.bingfor.easycablelink.my;

import android.databinding.ObservableInt;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.Toolbar;

import com.bingfor.easycablelink.R;
import com.bingfor.easycablelink.base.BaseRecyclerViewActivity;
import com.bingfor.easycablelink.databinding.ActivityOrderListBinding;
import com.bingfor.easycablelink.databinding.BaseRecyclerviewBinding;

public class OrderListActivity extends BaseRecyclerViewActivity {

    public BaseRecyclerviewBinding binding;
    OrderListAdapter adapter = new OrderListAdapter(mContext);
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = BaseRecyclerviewBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        initToolbar();
    }

    @Override
    public void initToolbar() {
        Toolbar toolbar = $(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        setTitle("订单");
        initViews();
    }

    @Override
    public void refresh() {

    }

    @Override
    public void reload() {

    }
    @Override
    public void initViews() {
    super.initViews();
        binding.setStatus(new ObservableInt(1));
        pageStatus.set(PAGE_STATUS_SHOW);
        mRecyclerView.setLayoutManager(mLayoutManager = new LinearLayoutManager(mContext));
        mRecyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL));
        mRecyclerView.setAdapter(adapter);

    }
}
